'\" te
.\"  Copyright (c) 2005, 4Front Technologies 2005\&.
.TH ossddk_dmap_get_fragsize 9ossddk "12 Sep 2005" "SunOS 5.10" "OSS DDK Services"
.SH "NAME"
ossddk_dmap_get_fragsize, ossddk_dmap_set_fragsize, ossddk_dmap_get_numfrags, ossddk_dmap_set_numfrags \- Set/get DMA buffer partitioning parameters
.PP
.SH "SYNOPSIS"
.nf
#include <sys/soundcard.h>
.LP
#include <sys/ossddk/ossddk.h>
.fi
.LP
\fBint\fR ossddk_dmap_get_fragsize(\fBdmap_t *\fIdmap\fP);
\fBint\fR ossddk_dmap_get_numfrags(\fBdmap_t *\fIdmap\fP);
\fBvoid\fR ossddk_dmap_set_fragsize(\fBdmap_t *\fIdmap\fP, \fBint \fIsize\fP);
\fBvoid\fR ossddk_dmap_set_numfrags(\fBdmap_t *\fIdmap\fP, \fBint \fInfrags\fP);
.PP
.SH "INTERFACE LEVEL"
.PP
Open Sound System specific (OSS 4.0 DDK)\&.
.PP
.SH "ARGUMENTS"
.PP
.sp
.ne 2
.mk
\fB\fIdmap\fR
.in +16n
.rt
Audio buffer handle.
.in -16n
.sp
.ne 2
.mk
\fB\fInfrags\fR
.in +16n
.rt
Number of fragments.
.in -16n
.sp
.ne 2
.mk
\fB\fIsize\fR
.in +16n
.rt
Fragment size in bytes.
.in -16n
.PP
.SH "DESCRIPTION"
.PP
The DMA buffer maintained by OSS audio core is divided to number of fragments
with equal size. The driver should program the device to raice an interrupt
on every fragment boundary. The driver can get the fragment size (in bytes) by
calling \fIossddk_dmap_get_fragsize\fR. If the number of fragments is needed it
can be obtained with \fIossddk_dmap_get_numfrags\fR.
.PP
It is also possible to set these parameters but it should be avoided if
possible. Changing these parameters may cause unpredictable problems and is
bot supported by 4Front Technologies. If the driver changes these parameters it must ensure that fragment_size*num_fragments doesn't (even temporarily) become
larger than the total size of the allocated buffer. Otherwise the result will be
something else than what was intended by the driver. These parameters can only
be changed in the prepare_for_input and prepare_for_output methods of the
driver. As a side effect the value returned by \fIossddk_dmap_get_buffused(9ossddk)\fR will also get changed automatically. An undesired side effect is that
the fragment size possibly reported to the application will no longer be valid
which probably breaks some incorrectly designed applications.
.PP
.SH "RETURN VALUES"
\fIossddk_dmap_get_fragsize\fR returns the current fragment size in bytes.
.LP
\fIossddk_dmap_get_numfrags\fR returns the number of fragments currently in use.
.PP
.SH "SEE ALSO"
.PP
\fIWriting Sound Device Drivers with OSS DDK\fR
.LP
\fIOpen Sound System Programmer's Guide\fR
